package org.example.maven.service.Impl;

import com.github.pagehelper.PageHelper;
import org.example.maven.mapper.OperateMapper;
import org.example.maven.pojo.operation.OperateList;
import org.example.maven.pojo.operation.OperationLog;
import org.example.maven.pojo.operation.SearchOperate;
import org.example.maven.service.OperateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class operateServiceImpl implements OperateService {
    @Autowired
    private OperateMapper operateMapper;

    @Override
    public void addOperateLog(OperationLog operationLog) {
        operateMapper.addOperateLog(operationLog);
    }

    @Override
    public List<OperateList> getOperateList(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return operateMapper.getOperateList();
    }

    @Override
    public List<OperateList> getAllOperate() {
        return operateMapper.getOperateList();
    }

    @Override
    public Integer getOperateCount(SearchOperate searchOperate) {
        return operateMapper.getOperateCount(searchOperate);
    }

    @Override
    public List<OperateList> getSpecieOperation(SearchOperate searchOperate, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        return operateMapper.getSpecieOperation(searchOperate);
    }

    @Override
    public void deleteOperation(String[] id) {
        operateMapper.deleteOperation(id);
    }

    @Override
    public void deleteOperationAll() {
        operateMapper.deleteOperationAll();
    }
}
